<!-- CloudFormation stack partial -->
<script id="services.cloudformation.regions.id.stacks.partial" type="text/x-handlebars-template">
  <div id="resource-name" class="list-group-item active">
    <h4 class="list-group-item-heading">{{name}}</h4>
  </div>
  <div class="list-group-item">
    <h4 class="list-group-item-heading">Description</h4>
    <div class="list-group-item-text item-margin">{{Description}}</div>
  </div>
  <div class="list-group-item">
    <h4 class="list-group-item-heading">Information</h4>
    <div class="list-group-item-text item-margin">ARN: <span id="cloudformation.regions.{{region}}.stacks.{{@key}}.arn"><samp>{{arn}}</samp></span></div>
    <div class="list-group-item-text item-margin">Region: {{region}}</div>
    <div class="list-group-item-text item-margin">Created on: {{CreationTime}}</div>
    <div class="list-group-item-text item-margin" id="">Role:
      {{#if iam_role}}
        <a href="javascript:showObject('services.iam.roles.{{iam_role.id}}')">{{iam_role.name}}</a>
        <span id="cloudformation.regions.{{region}}.stacks.{{name}}"><i class="fa fa-exclamation-triangle"></i></span>
      {{else}}
        None
      {{/if}}
    </div>
    <div class="list-group-item-text item-margin">Termination protection enabled: <span id="cloudformation.regions.{{region}}.stacks.{{@key}}.cloudformation_stack_no_termination_protection">{{EnableTerminationProtection}}</span></div>
    <div class="list-group-item-text item-margin">Configuration has drifted: <span id="cloudformation.regions.{{region}}.stacks.{{@key}}.cloudformation_stack_drifted">{{drifted}}</span></div>
    <div class="list-group-item-text item-margin">Deletion policy: <span id="cloudformation.regions.{{region}}.stacks.{{@key}}.cloudformation_stack_no_deletion_policy">{{deletion_policy}}</span></div>
    <div class="list-group-item-text item-margin">Notification ARNs:
      <span id="cloudformation.regions.{{region}}.stacks.{{@key}}.cloudformation_stack_lacks_notifications">
        <ul>
        {{#each notificationARNs}}
            <li class="list-group-item-text"><samp>{{this}}</samp></li>
        {{else}}
            <li class="list-group-item-text"><samp>None</samp></li>
        {{/each}}
        </ul>
      </span>
    </div>
  </div>
  <div class="list-group-item">
    <h4 class="list-group-item-heading">Capabilities {{> count_badge count=Capabilities.length}}</h4>
    <ul>
      {{#each Capabilities}}
        <li class="list-group-item-text">
          {{this}}
        </li>
      {{/each}}
    </ul>
  </div>
  {{#if policy}}
    <div class="list-group-item">
      {{> accordion_policy name = 'Stack Policy' policy_path = (concat 'cloudformation.regions' region 'stacks' @key 'policy') document = policy}}
    </div>
  {{/if}}
</script>

<script>
  Handlebars.registerPartial("services.cloudformation.regions.id.stacks", $("#services\\.cloudformation\\.regions\\.id\\.stacks\\.partial").html());
</script>

<!-- Single CloudFormation stack template -->
<script id="single_cloudformation_stack-template" type="text/x-handlebars-template">
  {{> modal-template template='services.cloudformation.regions.id.stacks' }}
</script>

<script>
  var single_cloudformation_stack_template = Handlebars.compile($("#single_cloudformation_stack-template").html());
</script>
